package com.ftg.rbac.service.impl;

import com.ftg.rbac.mapper.DemoMapper;
import com.ftg.rbac.util.MybatisUtil;
import com.ftg.rbac.util.TreeUtil;
import com.ftg.rbac.vo.DemoTreeVo;

/**
 * @author kangjx
 * @version 1.0
 * @date 2023/3/20 下午5:22
 */
public class DemoService {

    DemoMapper demoMapper = MybatisUtil.getInstance(DemoMapper.class);

    public DemoTreeVo showTree(){
        return TreeUtil.createTree("pid","id","lists", DemoTreeVo.class,demoMapper.list(),-1);
    }

    public static void main(String[] args) {
        DemoService d = new DemoService();
        System.out.println(d.showTree());
    }

}
